home *** CD-ROM | disk | FTP | other *** search
- Path: futures.wharton.upenn.edu!ryan05
- From: ryan05@futures.wharton.upenn.edu (Arthur Ryan)
- Newsgroups: comp.lang.c++
- Subject: Error C2674 & Beginner's Array Assistance
- Date: 18 Jan 1996 01:39:38 GMT
- Organization: University of Pennsylvania
- Message-ID: <4dk8cq$14q@netnews.upenn.edu>
- NNTP-Posting-Host: futures.wharton.upenn.edu
- X-Newsreader: TIN [version 1.2 PL2-upenn1.1]
-
- How do you get around error C2674. When I run the code below the
- compiler returns the message - 'error C2674: '>>' : no accpetable
- conversions from 'int' to class ::ifstream' Cl returned error code 2' -
- The file to read in to the array is a 'CSV' file containing numeric
- values of differing lenghts. Thanks for your help. ARyan
-
-
- Code below:-
-
- #include <iostream.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <fstream.h>
- #include <io.h>
-
- disp_menu();
- data_in();
-
- int huge oda[774][29]; //huge array 'oda'
-
- main()
- {
- menu display and branching etc ...
-
- }
-
- data_in()
- {
- int i,j;
-
- ifstream fsin;
- fsin.open("A:\n&n\test.csv",ios::in);
-
- if(fsin.bad())
- {
- cout << "\n*** Serious I/O error ***\n";
- exit(0);
- }
-
-
- while (!fsin.eof())
- for (i=0;i<775;i++)
- {
- for(j=0;j<29;j++)
- {
- fsin >> oda [i][j];
- }
- ;
- }
-
- fsin.close();
-
- for (i=0;i<775;i++)
- {
- for (j=0;j<29;j++)
- {
- cout << oda [i][j];
- }
- cout << endl;
- }
-
- return(0);
- }
-